var push = require('./push');
var options = {
	APPID: 'HgmeUkPfTN6LqX13sJaMH9',
	APPKEY: 'RIKHHKDJOX7gwkZSiFmuU5',
	MASTERSECRET: '1qqQyr4AjJ98oG1BDoS144',
	PUSH_ERROR_EVENT: 'push-error',
	PUSH_SUCCESS_EVENT: 'push-success',
	MsgTypes: ['TransmissionMsg', 'NotifyMsg', 'LinkMsg'],

};
var clientid = '3ac353a6ac3bc553e014baf21196f748';
var pusher =  new push(options);
pusher.onError();
pusher.onSuccess();

/**
 * notifyAndirodPush
 * @constructor 
 * @param {content}
 * @param {clientid}
 * @param {clientids}
 * @param {appkey}
 * @return
 */

exports.andiordPush = function (content, clientid, clientids, appkey, callback) {
	if (!content || content == null) return callback('content not exists');
	pusher.content = content;
	if (clientid) {
		pusher.clientid = clientid;	
		pusher.pushMessage(0);
		callback();
	} else if (clientids) {
		pusher.clientids = clientids;	
		pusher.pushSpecifyMessage(0);
		callback();
	} else if (appkey) {
		pusher.pushGroupMessage(0);
		callback();
	} else {
		return callback('error');	
	}
};
 
